<?
require_once ('../../models/Users.php');
$results = Users::GetAll();
?>


<!DOCTYPE html>
<html lang="en">
	<? include('../../inc/head.php'); ?>
	<body>
		<div>
			<? include('../../inc/nav.php'); ?>

			<div id="content">
				<a href="edit.php" >+ Create New</a>
				
				<table class="table table-bordered table-condensed table-hover table-striped">
					<tr>
						<th>First Name</th><th>Last Name</th><th>Actions</th>
					</tr>
					
					<? while($row = $results->fetch_assoc()): ?>
						<tr>
							<td><?=$row['FirstName']?></td> <td><?=$row['LastName']?> </td>
							<td>
								<a href="details.php?id=<?=$row['id']?>">Details</a>
								<a href="edit.php?id=<?=$row['id']?>">Edit</a>
								<a href="delete.php?id=<?=$row['id']?>" class="delete-link">Delete</a>
							</td>					
						</tr>
					<? endwhile; ?>
					
				</table>
				
			</div>
			<? include('../../inc/footer.php'); ?>
		</div>
		
		    <div class="modal hide fade">
    				<div class="modal-header">
    					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
   					 <h3>Modal header</h3>
   				 </div>
   		 <div class="modal-body">
    		<p>One fine body…</p>
    	</div>
    	<div class="modal-footer">
    		<a href="#" class="btn">Close</a>
   		 <a href="#" class="btn btn-primary">Save changes</a>
   		 </div>
    	</div>
    	<script type="textt/javascript">
    		$(function()){
    			$(".close").click(function(){
    				$(this).closest(".alert").slideUp();
    			});
    		$(".error").removeClass('error', 'slow');
    		$(".delete-link").click(function(){
    			
    		})
    		}
    	</script>
    	
	</body>
</html>
